Next | Prev | Up | Top | Contents | Index
DKI Changes
The changes from the new DKI affect the driver routines called by the rest of the IRIX kernel, both the *devsw entry points and the interrupt handlers. The details of these interfaces are described in the IRIX Device Driver Reference Pages . The primary changes are:
- Device numbers are passed as a dev_t rather than as an int in prior IRIX versions. As mentioned elsewhere, the DDI contains new functions to access the major and minor numbers. Note that open takes a dev_t *, while read and write take a dev_t (no indirection).
- Many of the entry points (open, close, read, write) take a new argument that is an opaque credentials structure. (It is opaque in the sense that the device driver never examines the internal makeup of the structure.) This is used to call the DDI drv_priv() routine, which takes the place of checking u.u_uid == 0. This permits different models of privileges to be used, for example, in a trusted system.
- The read and write routines take a uio_t *, a pointer to a structure that defines the addresses and lengths of the data in the user space. (The IRIX Device Driver Reference Pages describe this structure. It is defined in /usr/include/sys/uio.h.) Previously, this information was computed in the driver from the u vector. The driver typically passes this structure to a DMA setup routine such as the DDI uiophysio() or the Silicon Graphics enhancement, biophysio(), which is nearly identical to iophysio(), except that it takes a block number instead of a file offset).
- Generally, drivers can no longer access the u vector directly. DDI defines access routines for fields in the u vector. Direct access to the u vector tends to make a driver more dependent on specific aspects of the system than is desirable. This also extends to access u.u_error. DKI expect to return the error value (0 indicates no error), and are not supposed to set u.u_error.
- Interrupt routines are now of type void.
Addressability
The driver needs to arrange for addressability of the device registers in the CHALLENGE/Onyx family and, in the interest of having common code for VME drivers between the POWER Series(TM) and these systems, drivers must set up the appropriate mappings. This is done by the new pio_map() routines, which have similar calling interfaces to the dma_map() routines from prior versions.
Next | Prev | Up | Top | Contents | Index